package com.ucode.application.form.crm;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.ucode.springboot.starter.web.validator.annotation.CheckMember;
import com.ucode.springboot.starter.web.validator.group.AddGroup;
import com.ucode.springboot.starter.web.validator.group.UpdateGroup;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@SuppressWarnings("serial")
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="商机")
public class BusinessForm implements Serializable{

    /**
     * 商机状态组Id
     */
    @ApiModelProperty(value = "商机状态组",required=true)
    @NotNull(message="请选择商机状态组", groups = {AddGroup.class,UpdateGroup.class})
    private Long groupId;
    /**
     * 商机状态Id
     */
    @ApiModelProperty(value = "商机状态",required=true)
    @NotNull(message="请选择商机状态", groups = {AddGroup.class,UpdateGroup.class})
    private Long statusId;
    /**
     * 客户Id
     */
    @ApiModelProperty(value = "客户",required=true)
    @NotNull(message="客户不能为空", groups = {AddGroup.class})
    private Long customerId;
    /**
     * 商机名称
     */
    @ApiModelProperty(value = "商机名称",required=true)
    @NotBlank(message = "商机名称不能为空", groups = {AddGroup.class,UpdateGroup.class})
    @Length(max=100,message = "商机名称最大200个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String name;
    
    /**
     * 商机预计金额,单位分
     */
    @ApiModelProperty(value = "商机预计金额,单位分",required=false)
    private Integer expectAmount;
    /**
     * 预计成交日期
     */
    @ApiModelProperty(value = "预计成交日期",required=false)
    private Date expectDealDate;
    
    /**
     * 备注
     */
    @ApiModelProperty(value = "备注",required=false)
    @Length(max=100,message = "备注最大500个字符", groups = {AddGroup.class,UpdateGroup.class})
    private String  remark;

    /**
     * 下次跟进时间
     */
    @ApiModelProperty(value = "下次跟进时间",required=false)
    private Date nextTime;

    /**
     * 是否允许客户团队同步添加:0允许1不允许
     */
    @ApiModelProperty(value = "是否允许客户团队同步添加:0允许1不允许",required=false,example="0")
    @CheckMember(value={"0","1"},message="是否允许客户团队同步添加非法", groups = {AddGroup.class,UpdateGroup.class})
    private Integer synAdd;

    
}
